package LeetcodeTest;

/**
 * Created by lch on 19/12/16.
 */
import java.util.*;
public class Test2{

    List<Integer> list=new ArrayList<Integer>();
    public List<Integer> getRow(int rowIndex)
    {
        int [][]pas=new int[rowIndex+1][rowIndex+1];

        for(int i=0;i<=rowIndex;i++)
        {
            for(int j=0;j<=i;j++)
            {
                if(j==0)
                {
                    pas[i][0]=1;
                }
                else
                {
                    pas[i][j]=pas[i-1][j-1]+pas[i-1][j];
                }
            }

            if(i==rowIndex)
            {
                for(int j=0;j<=i;j++)
                {
                    list.add(pas[i][j]);
                }
            }
        }

        return list;
    }

    public static void main(String []args)
    {
        Test2 test=new Test2();
        Scanner scan=new Scanner(System.in);
        int rowIndex=scan.nextInt();

        List<Integer> list=test.getRow(rowIndex);

        Iterator<Integer> it=list.iterator();
        while(it.hasNext())
        {
            int data=it.next();
            System.out.print(data+" ");
        }
        System.out.println();
    }
}
